# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-jsonschema-spec
pkgver=0.1.3
pkgrel=1
pkgdesc="JSONSchema Spec with object-oriented paths"
url="https://github.com/p1c2u/jsonschema-spec"
license=('Apache')
arch=('any')
depends=('python-jsonschema' 'python-pathable' 'python-yaml' 'python-typing_extensions')
makedepends=('python-build' 'python-installer' 'python-poetry-core')
checkdepends=('python-pytest')
source=("https://github.com/p1c2u/jsonschema-spec/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('95465c43b842289ed28dd78ec06614d77b2bbf7d9d69e5dc4b89008740d0cc85e5b3319acd66d0142b533425e8f150c4edbbf15b7f8e3bdefb28b81193a13432')

prepare() {
  cd jsonschema-spec-$pkgver
  sed -i '/--cov/d' pyproject.toml
}

build() {
  cd jsonschema-spec-$pkgver
  python -m build -wn
}

check() {
  cd jsonschema-spec-$pkgver
  PYTHONPATH="$PWD" pytest
}

package() {
  cd jsonschema-spec-$pkgver
  python -m installer -d "$pkgdir" dist/*.whl
}
